import log4js from 'log4js'

const {LOG_LEVEL} = process.env

log4js.configure({
    appenders: {
       /*  file: {
            type: 'file',
            filename: "console.log",
        }, */
        datafile: {
            type: 'dateFile',
            filename: "logs/report.log",
            pattern: ".yyyy-MM-dd"
        },
        console: {type: 'console'},
    },
    categories: {
        default: {appenders: ['datafile', 'console'], level: LOG_LEVEL},
    }
});

export const logger = log4js.getLogger('default');

